package com.example.cd5160866.tabs.camera;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class MyDemoSurfaceView extends SurfaceView implements SurfaceHolder.Callback {

    public MyDemoSurfaceView(Context context) {
        super(context, null);
    }

    public MyDemoSurfaceView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        getHolder().addCallback(this);
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder) {
        Log.d("qw", "surfaceCreated");
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        Log.d("qw", "surfaceChanged   format " + format + " width " + width + " height " + height);
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {
        Log.d("qw", "surfaceDestroyed");
    }
}
